<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layout/t.xhtml">

	<ui:define name="title">
		<h:outputText value="Gestione Menu (passo 1)" />
	</ui:define>
	<ui:define name="roles">
		<f:attribute name="roles" value="menu" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<center>
				<p:panel header="Gestione Menu (passo 1)">

					<h:panelGrid columns="2" style="width: 95%"
						columnClasses="col1,col2">

						<h:outputLabel value="Nome(*):" for="nome" />
						<h:inputText id="nome" value="#{menuController.element.name}"
							style="width: 100%;" required="true" />

						<h:outputLabel value="Descrizione:" for="descrizione" />
						<h:inputText id="descrizione"
							value="#{menuController.element.description}"
							style="width: 100%;" />

						<h:outputLabel value="Percorso(*):" for="percorso" />
						<h:inputText id="percorso"
							value="#{menuController.element.path}" style="width: 100%;" />

						<h:outputLabel value="Dinamico:" for="dynamic" />
						<h:selectBooleanCheckbox id="dynamic" 
							value="#{menuController.element.dynamic}" />

					</h:panelGrid>
					<br />
					<h:outputText value="(*) sono campi obbligatori!" />
					<br />
					<br />

				</p:panel>
				<br /> <br />

				<h:panelGrid columns="3">
					<h:commandButton action="#{menuController.step2}"
						value="Prosegui (selezione pagine)" />

					<h:commandButton action="#{menuController.delete}" value="Elimina"
						immediate="true" rendered="#{not empty menuController.element.id}"
						onclick="if (!confirm('Vuoi davvero eliminare?')) return false" />

					<h:commandButton id="reset" action="#{menuController.reset}"
						value="Annulla" immediate="true" />
				</h:panelGrid>
			</center>

		</h:form>
	</ui:define>
</ui:composition>